WITHDRAW_SUB_TYPE_DCT = {
    'platform_routing': True,
    'dark3': {
        '10': {'name': "银行卡"},
        '11': {'name': "JustPay"}
    },
    'dark4': {
        '10': {'name': "银行卡"},
        '11': {'name': "JustPay"}
    }
}


EVENT_RULES = {
    "aggs": {
        "groups": [
            {
                "group_name": "提现类型／提现通道",
                "field_id": "withdraw_sub_type",
                "is_keyword": True,
                "field_name": "提现类型"
            },
            {
                "group_name": "渠道",
                "field_id": "_chn",
                "is_keyword": True,
                "field_name": "渠道"
            }
        ],
        "values": [
            {
                "value_id": "withdraw_price",
                "value_name": "提现金额",
                "fmt": "\"%.2f\" % a",
                "adjust_amount": True,
            }
        ],
        "uv": {
            "field_id": "_user_id",
            "field_name": "投注人次"
        },
        "pv": {
            "field_name": "投注次数"
        }
    }
}

EVENT_CONFIG = {
    "event_id": "withdraw",
    "event_name": "提現成功統計",
    "values": {
        "_user_id": {
            "field_name": "用戶ID",
            "value_type": "long",
        },
        "out_trans_id": {
            "field_name": "提現訂單",
            "value_type": "string",
            "required": False
        },
        "sub_type": {
            "field_name": "提現類型",
            "value_type": "string",
            "enum": {
                "target_enum_dct": WITHDRAW_SUB_TYPE_DCT
            }
        },
        "third_type": {
            "field_name": "提現渠道",
            "value_type": "string",
            "required": False,
            "detail_invisible": True
        },
        "price": {
            "field_name": "提现金额",
            "value_type": "float",
        },
        "real_price": {
            "field_name": "实际提现金额",
            "value_type": "float",
        },
        "third_time": {
            "field_name": "轉交第三方時間",
            "value_type": "long"
        },
        "_event_time": {
            "field_name": "提现完成时间",
            "value_type": "long",
        },
        "apply_time": {
            "field_name": "充值申请时间",
            "value_type": "long",
            "required": False,
        }
    }
}
